/**
* 珠宝知识 模块 - 组件 
*/
<template>
  <div class="h-knowledge">
    <div class="h-hidden">
      <figure-write :figureData="item" :key="item.id" v-for="item in knowledgeList"></figure-write>
    </div>
    <!-- 分页 -->
    <el-pagination :current-page.sync="pagination.pageNum" :hide-on-single-page="true" :page-size="pagination.pageSize" :total="pagination.total"
                               @current-change="handleCurrentChange"
                               background layout="prev, pager, next"></el-pagination>
  </div>
</template>
<script>
//import { brandList } from '@/mock' // 珠宝知识 数据
import { enterpriseData } from '@/api'
import FigureWrite from '@/components/FigureWrite'

export default {
  name: 'Knowledge',
  components: { FigureWrite },
  props: {},
  data () {
    return {
      knowledgeList: [], // 珠宝知识
      pagination: {
        total: 0,
        pageNum: 1, // 当前页
        pageSize: 9, // 每页条数
      }
    }
  },
  created () {
     this.getKnowledgeData() // 珠宝知识 数据加载
  },
  mounted () {
    //this.knowledgeList = brandList.result.list // 使用接口时 此处删除
  },
  methods: {
    getKnowledgeData () {
      const params = { // 请求参数 --- 根据情况 是否需要
        t: 'ZBZS'
      }
      enterpriseData({ ...params, ...this.pagination1 }).then(res => {
        this.knowledgeList = res.list
        this.pagination1.total = res.total
      })
    },
    /**
     *@Description
     *@Param
     *@Return 分页.
     **/
    handleCurrentChange (val) {
      this.pagination.pageNum = val
      this.getKnowledgeData()
    },
  }
}
</script>

<style lang="scss" scoped>
  .h-knowledge {
  }
</style>
